﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Tier3CommonDALGloria;
using DALGloria.DALGloria;


namespace ListaPdt
{
    public partial class frmListaArticulo : Form
    {
        public frmListaArticulo()
        {
            InitializeComponent();
        }

        private void timer_Tick(object sender, EventArgs e){
            dgvPdtDentro.DataSource = null;
            dgvPdtFuera.DataSource = null;

            frmListaPdt_Load(sender, e);
        }

        private void frmListaPdt_Load(object sender, EventArgs e) {

            ArticuloVWDAL pdt = new ArticuloVWDAL();

            List<VW_LISTAENTRADA> listaEntrada = pdt.BuscarListaEntrada();

            dgvPdtDentro.DataSource = listaEntrada;

            dgvPdtDentro.Columns[0].HeaderText = "N°";
            dgvPdtDentro.Columns[3].HeaderText = "Fecha Entrada";
            dgvPdtDentro.Columns[4].HeaderText = "Nombre";
            dgvPdtDentro.Columns[5].HeaderText = "S/N";
            dgvPdtDentro.Columns[6].HeaderText = "MFD";
            dgvPdtDentro.Columns[7].HeaderText = "Tipo";


            dgvPdtDentro.Columns[1].Visible = false;
            dgvPdtDentro.Columns[2].Visible = false;
            dgvPdtDentro.Columns[8].Visible = false;

            dgvPdtDentro.Columns[0].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
            dgvPdtDentro.Columns[1].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
            dgvPdtDentro.Columns[2].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
            dgvPdtDentro.Columns[3].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
            dgvPdtDentro.Columns[4].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
            dgvPdtDentro.Columns[5].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
            dgvPdtDentro.Columns[6].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
            dgvPdtDentro.Columns[7].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;


            List<VW_LISTASALIDA> listaSalida = pdt.BuscarListaSalida();

            dgvPdtFuera.DataSource = listaSalida;

            dgvPdtFuera.Columns[0].HeaderText = "N°";
            dgvPdtFuera.Columns[3].HeaderText = "Fecha Salida";
            dgvPdtFuera.Columns[4].HeaderText = "Usuario";
            dgvPdtFuera.Columns[5].HeaderText = "Nombre";
            dgvPdtFuera.Columns[6].HeaderText = "S/N";
            dgvPdtFuera.Columns[7].HeaderText = "MFD";
            dgvPdtFuera.Columns[8].HeaderText = "Tipo";

            dgvPdtFuera.Columns[1].Visible = false;
            dgvPdtFuera.Columns[2].Visible = false;
            dgvPdtFuera.Columns[9].Visible = false;

            dgvPdtFuera.Columns[0].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
            dgvPdtFuera.Columns[1].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
            dgvPdtFuera.Columns[2].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
            dgvPdtFuera.Columns[3].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
            dgvPdtFuera.Columns[4].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
            dgvPdtFuera.Columns[5].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
            dgvPdtFuera.Columns[6].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
            dgvPdtFuera.Columns[7].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
            dgvPdtFuera.Columns[8].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
            
        }

        private void cargarGrilla() {
            
        }

        private void dgvPdtDentro_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            
        }
    }
}
